///************************************************************************
/// <copyrigth>2018-2019 Corporation.All Rights Reserved</copyrigth>
/// <author>tangyingzhong</author>
/// <contact>tangyz114987@outlook.com</contact>
/// <version>v1.0.0</version>
/// <describe>
/// It is an subject will be obseverd(Observer mode)
///</describe>
/// <date>2019/12/10</date>
///***********************************************************************
#ifndef IEVENTBASE_H
#define IEVENTBASE_H

#include "EventHandler/IEventHandler.h"

namespace SystemTool
{
	class IEventBase
	{
	public:
		typedef IEventHandler::HandlerFunc HandlerFunc;

	public:
		// Virtual destruct the event base
		virtual ~IEventBase() {	}

		// Listen to the object
		virtual bool Listen(void* pListener,
			HandlerFunc pListenHandler,
			int iEventID) = 0;

		// UnListen to the object
		virtual bool UnListen(void* pListener,
			HandlerFunc pListenHandler,
			int iEventID) = 0;

		// UnListen receiver
		virtual bool UnListen(void* pListener) = 0;

		// UnListen receiver's event id
		virtual bool UnListen(void* pListener, int iEventID) = 0;

		// UnListen to event id
		virtual bool UnListen(int iEventID) = 0;

		// UnListen to event id's handler function
		virtual bool UnListen(int iEventID, HandlerFunc pListenHandler) = 0;

		// UnListen to the handler function
		virtual bool UnListen(HandlerFunc pListenHandler) = 0;
	};
}

#endif // IEVENTBASE_H
